home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Kara Collection
/
Kara Collection v3.0 (1996-09-12)(Cloanto).iso
/
ppaint
/
rexx
/
animtoframes.pprx
< prev
next >
Wrap
Text File
|
1995-09-16
|
2KB
|
84 lines
/* PPaint Amiga Rexx script - Copyright © 1995 Cloanto Italia srl */
/*
$VER: AnimToFrames.pprx 1.1
*/
MYPORT = 'PPAINT'
IF ~SHOW('P', MYPORT) THEN DO
IF EXISTS('PPaint:PPaint') THEN DO
ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
DO 30 WHILE ~SHOW('P',MYPORT)
ADDRESS COMMAND 'Wait >NIL: 1 SEC'
END
END
ELSE DO
SAY "Personal Paint could not be loaded."
EXIT 10
END
END
IF ~SHOW('P', MYPORT) THEN DO
SAY 'Personal Paint Rexx port could not be opened.'
EXIT 10
END
ADDRESS VALUE MYPORT
OPTIONS RESULTS
OPTIONS FAILAT 10000
Version 'REXX'
IF RESULT < 3 THEN DO
errmess = 'This script requires a newer_version of Personal Paint.'
SAY errmess
RequestNotify 'PROMPT="'errmess'"'
EXIT 10
END
LockGUI
GetFrameNum
frames = RESULT
IF frames = 0 THEN DO
RequestFile '"Select Animation"'
IF RC = 0 THEN DO
LoadAnim RESULT NEW
GetFrameNum
frames = RESULT
END
END
IF frames > 0 THEN DO
RequestFile 'TITLE "Select Format and Root Name for Frame Files" SAVEMODE FORMATS FORCE'
IF RC = 0 THEN DO
savedata = RESULT
endf = INDEX(savedata, '"', 2)
filename = SUBSTR(savedata, 2, endf - 2)
filedata = SUBSTR(savedata, endf + 1)
GetFramePos
savepos = RESULT
errcode = 0
SetFramePos 1
DO fnum = 1 TO frames
fname = filename || "." || RIGHT(fnum, 3, "0")
SaveImage '"'fname'"'filedata FORCE QUIET
IF RC ~= 0 THEN DO
IF RC = 5 THEN
errmess = 'User abort during save.'
ELSE
errmess = 'Error 'RC' during save.'
errcode = RC
LEAVE
END
SetFramePos NEXT
END
SetFramePos savepos
IF errcode > 0 THEN DO
SAY errmess
RequestNotify 'PROMPT="'errmess'"'
END
END
END
UnlockGUI